package cn.cl.mapper;

import cn.cl.bean.Employee;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 标题：
 * 作者：何处是归程
 * 时间：2020/3/31 - 20:20
 */
public interface EmployeeMapper {
	@Select("select * from employee where id = #{id}")
	public Employee getEmpById(Integer id);

	@Update("update employee set lastName = #{lastName}, email=#{email},gender=#{gender},d_id=#{dId} where id = #{id}")
	public void updateEmp(Employee employee);

	@Delete("delete from employee where id = #{id}")
	public void deleteEmp(Integer id);

	@Insert("insert into employee(lastName, email, gender, d_id) values(#{lastName}, #{email}, #{gender}, #{dId})")
	public void insertEmp(Employee employee);

	@Select("select * from employee where lastName = #{lastName}")
	Employee getEmpByLastName(String lastName);
}
